﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Riel_Gestion
{
    public partial class FrmListadoProveedores : Form
    {
        FrmMain parent = null;

        public FrmListadoProveedores(FrmMain parent)
        {
            this.parent = parent;
            InitializeComponent();
        }

        private void pROVEEDORESBindingNavigatorSaveItem_Click(object sender, EventArgs e)
        {
            this.Validate();
            this.pROVEEDORESBindingSource.EndEdit();
            this.tableAdapterManager.UpdateAll(this.rielDataSet);

        }

        private void FrmListadoProveedores_Load(object sender, EventArgs e)
        {            
            this.pROVEEDORESTableAdapter.Fill(this.rielDataSet.PROVEEDORES);
        }

        private void pROVEEDORESDataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 7)
            {
                FrmFichaProveedor frmprov = new FrmFichaProveedor();
                frmprov.IdProveedor = pROVEEDORESDataGridView.Rows[e.RowIndex].Cells[0].Value.ToString();
                frmprov.MdiParent = this.parent;
                frmprov.Show();
            }
        }

        private void btnAceptar_Click(object sender, EventArgs e)
        {
            this.Close();
        }

      
    }
}
